{template '../../header'}
{template '../../left'}

<div class="card">
    <div class="card-header">
        修改权限
    </div>
    <div class="card-body">
        <form method="post" class="form-row">
            <div class="col-6">
                <div class="row">
                    <div class="col-4">
                        <div class="form-group">
                            <label>权限名称</label>
                            <input class="form-control form-control-sm" type="text" id="title" name="title" value="<?php echo $detail['title']; ?>" />
                        </div>
                    </div>
                    <div class="col-8">
                        <div class="form-group">
                            <label>所属父级</label>
                            <select id="parent_id" name="parent_id" class="form-control form-control-sm">
                                {loop $routes $route}
                                {if $id}
                                <option value="{$route['id']}" {if $detail['parent_id'] == $route['id']}selected{/if}>
                                {$route['title']}
                                </option>
                                {else}
                                <option value="{$route['id']}" {if $parent_id == $route['id']}selected{/if}>
                                {$route['title']}
                                </option>
                                {/if}
                                {/loop}
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-8">
                        <div class="form-group">
                            <label>URL地址</label>
                            <input class="form-control form-control-sm" type="text" id="url" name="url" value="<?php echo $detail['url']; ?>" placeholder="URL地址" />
                        </div>
                    </div>
                    <div class="col-4">
                        <div class="form-group">
                            <label>排序</label>
                            <input class="form-control form-control-sm" type="text" id="sort" name="sort" value="<?php echo $detail['sort']; ?>" />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-12">
                        <div class="form-group">
                            <button type="submit" class="btn btn-success btn-sm"><i class="fa fa-save"></i> 保存</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

{template '../../footer'}